# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_pkgname=databases
pkgname=python-$_pkgname
pkgver=0.6.2
pkgrel=2
pkgdesc='Async database support for Python'
arch=('any')
url='https://github.com/encode/databases'
license=('BSD')
depends=('python')
makedepends=('python-setuptools')
optdepends=('python-asyncpg: postgresql support'
            'python-aiopg: postgresql + aiopg support'
            'python-aiomysql: mysql support'
            'python-aiosqlite: sqlite support')
#checkdepends=('python-pytest-runner' 'python-asyncpg' 'python-psycopg2' 'python-aiopg'
#              'python-aiomysql' 'python-pymysql' 'python-aiosqlite' 'python-sqlalchemy'
#              'python-starlette' 'python-requests')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('54ea72b39ac40d080ac2efec3db36719ac61688fdbe69933d1e32dabeadf009bf95c6f56b8e2d50c40a49a83fe4c82bfbf9f76b75e0ac62c0056e4ef73e3d336')

# TODO: fix tests (need databases)

build() {
  cd $_pkgname-$pkgver

  python setup.py build
}

#check() {
#  cd $_pkgname-$pkgver
#
#  python setup.py pytest
#}

package() {
  cd $_pkgname-$pkgver

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
